﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using myomscl.Interfaces;

namespace myomscl.Presenters
{
    public class UserDetailsPresenter : Presenter
    {
        #region members

        private readonly IUserView view;

        #endregion

        #region constructor
        public UserDetailsPresenter(IUserView _view)
            : this(_view, null)
        { }

        public UserDetailsPresenter(IUserView _view, ISessionProvider session)
            : base(_view, session)
        {
            view = base.GetView<IUserView>();

            view.OnPasswordUpdate += view_Update;
            view.OnPasswordUpdateById += view_UpdateById;
        }

        #endregion

        #region private methods

        private void view_Update()
        {
            //view_UpdateById(CurrentUser.Id);
        }

        private void view_UpdateById(int id)
        {
            //var filter = new WorkflowFilter
            //{
            //    UserId = id,
            //    NewPassword = view.NewPassword
            //};

            //var filterSql = new WorkflowFilterSql(filter);
            //model.UpdatePassword(filterSql);
        }
        #endregion
    }
}
